package com.vshop.mapper;

import com.vshop.entity.comentity.PartnerPackage;
import com.vshop.entity.external.listpackage.response.ResponseServicePlanListTradeData;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

/**
 * 企业原始套餐数据库操作映射类
 *
 * @author lm
 * @date 2020/8/27 11:03
 */
@Mapper
public interface PartnerPackageMapper {
    /**
     * queryPackageByPartnerCode
     *
     * @param partnerCode
     * @param partnerScope
     * @return
     */
    List<PartnerPackage> queryPackageByPartnerCode(@Param("partnerCode") String partnerCode,
                                                   @Param("partnerScope") String partnerScope);

    /**
     * queryPackageByCode
     *
     * @param packageCode
     * @param partnerCode
     * @param partnerScope
     * @return
     */
    List<PartnerPackage> queryPackageByCode(@Param("packageCode") String packageCode,
                                            @Param("partnerCode") String partnerCode,
                                            @Param("partnerScope") String partnerScope);

    /**
     * queryPackageListByCode
     *
     * @param partnerCode
     * @param packageCode
     * @param salesType
     * @return
     */
    List<PartnerPackage> queryPackageListByCode(@Param("partnerCode") String partnerCode,
                                                @Param("packageCode") String packageCode,
                                                @Param("salesType") String salesType);

    /**
     * queryPackageNameEN
     *
     * @param partnerCode
     * @param packageCode
     * @return
     */
    String queryPackageNameEN(@Param("partnerCode") String partnerCode,
                              @Param("packageCode") String packageCode);

    /**
     * queryBuyType
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String queryBuyType(@Param("packageCode") String packageCode,
                        @Param("partnerCode") String partnerCode);

    /**
     * queryPackageNameByCode
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String queryPackageNameByCode(@Param("packageCode") String packageCode,
                                  @Param("partnerCode") String partnerCode);

    /**
     * queryPackageNameByCode
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String queryPriceType(@Param("packageCode") String packageCode,
                          @Param("partnerCode") String partnerCode);

    /**
     * queryMoreSpecailPackage
     *
     * @param partnerCode
     * @param partnerScope
     * @param salesType
     * @return
     */
    List<PartnerPackage> queryMoreSpecailPackage(@Param("partnerCode") String partnerCode,
                                                 @Param("partnerScope") String partnerScope,
                                                 @Param("salesType") String salesType);

    /**
     * queryListByCode
     *
     * @param partnerCode
     * @param packageCode
     * @return
     */
    List<PartnerPackage> queryListByCode(@Param("partnerCode") String partnerCode,
                                         @Param("packageCode") String packageCode);

    /**
     * queryPackageByCondition
     *
     * @param partnerCode
     * @param deviceCode
     * @param country
     * @param continent
     * @param packageType
     * @param salesType
     * @return
     */
    List<PartnerPackage> queryPackageByCondition(@Param("partnerCode") String partnerCode,
                                                 @Param("deviceCode") String deviceCode,
                                                 @Param("coverCountrys") String country,
                                                 @Param("continentName") String continent,
                                                 @Param("packageType") String packageType,
                                                 @Param("salesType") String salesType);

    /**
     * queryPackageByConditionEN
     *
     * @param partnerCode
     * @param deviceCode
     * @param country
     * @param continent
     * @param packageType
     * @param salesType
     * @return
     */
    List<PartnerPackage> queryPackageByConditionEN(@Param("partnerCode") String partnerCode,
                                                   @Param("deviceCode") String deviceCode,
                                                   @Param("coverCountrysEN") String country,
                                                   @Param("continentNameEN") String continent,
                                                   @Param("packageType") String packageType,
                                                   @Param("salesType") String salesType);

    /**
     * querySalesType
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String querySalesType(@Param("packageCode") String packageCode,
                          @Param("partnerCode") String partnerCode);

    /**
     * findCountByCondition
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    int findCountByCondition(@Param("packageCode") String packageCode,
                             @Param("partnerCode") String partnerCode);

    /**
     * storagePackage
     *
     * @param product
     */
    void storagePackage(PartnerPackage product);

    /**
     * queryPackageStatusByCode
     *
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String queryPackageStatusByCode(@Param("packageCode") String packageCode,
                                    @Param("partnerCode") String partnerCode);

    /**
     * updatePackageStatus
     *
     * @param product
     */
    void updatePackageStatus(PartnerPackage product);

    /**
     * queryTejiaPackageByCode
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> queryTejiaPackageByCode(@Param("partnerCode") String partnerCode,
                                                 @Param("deviceCode") String deviceCode);

    /**
     * queryPackageNameAs
     * @param partnerCode
     * @param packageCode
     * @return
     */
    String queryPackageNameAs(@Param("partnerCode") String partnerCode,
                              @Param("packageCode") String packageCode);

    /**
     * queryPackageTypeByCode
     * @param packageCode
     * @param partnerCode
     * @return
     */
    String queryPackageTypeByCode(@Param("packageCode") String packageCode,
                                  @Param("partnerCode") String partnerCode);

    /**
     * queryDesc
     * @param partnerCode
     * @param packageCode
     * @return
     */
    String queryDesc(@Param("partnerCode") String partnerCode,
                     @Param("packageCode") String packageCode);

    /**
     * queryDescEN
     * @param partnerCode
     * @param packageCode
     * @return
     */
    String queryDescEN(@Param("partnerCode") String partnerCode,
                       @Param("packageCode") String packageCode);

    //未分表之前的简版首页查询套餐列表的方法

    /**
     * querySimplePackageListByPartnerCode
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode(@Param("partnerCode") String partnerCode,
                                                             @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_0
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_0(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_1
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_1(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_2
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_2(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_3
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_3(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_4
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_4(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_5
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_5(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_6
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_6(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_7
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_7(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * querySimplePackageListByPartnerCode_8
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_8(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     *querySimplePackageListByPartnerCode_9
     * @param partnerCode
     * @param deviceCode
     * @return
     */
    List<PartnerPackage> querySimplePackageListByPartnerCode_9(@Param("partnerCode") String partnerCode,
                                                               @Param("deviceCode") String deviceCode);

    /**
     * getServicePlanList
     * @param partnerCode
     * @return
     */
    List<PartnerPackage> getServicePlanList(@Param("partnerCode") String partnerCode);

    /**
     * getPackageListByCode
     * @param partnerCode
     * @param packageCode
     * @return
     */
    List<PartnerPackage> getPackageListByCode(@Param("partnerCode") String partnerCode,
                                              @Param("packageCode") String packageCode);

    /**
     * update_package_usage_attribute
     * @param pro
     */
    void update_package_usage_attribute(PartnerPackage pro);
}